// plugins/hapi-swagger.js
const inert = require('inert');
const vision = require('vision');
const package = require('package');
const hapiSwagger = require('hapi-swagger');

module.exports = [
  inert,
  vision,
  {
    register: hapiSwagger,
    options: {
      info: {
        title: '接口文档',
        version: package.version,
      },
      // 定义接口以 tags 属性定义为分组
      grouping: 'tags',
      tags: [
        {name: 'orders', description: '订单相关（暂时没用）' },
        {name: 'tests', description: '测试相关' },
        {name: 'shops',description: '商铺相关'},
        {name: 'users',description: '用户验证相关'},
        {name: 'download',description: '文件下载相关'},
        {name: 'upload',description: '文件上传（参数是metadata）'},
        {name: 'aima',description: '老哥电动车店专用接口'},
        {name: 'wechat',description: '微信小程序专用接口'},
        {name: 'idcard',description: '身份证信息（聚合数据）'},
        {name: 'juhe',description: '聚合接口（聚合数据）'},
        {name: 'weather',description: '天气相关接口（心知天气）'}
      ]
    }
  }
]